#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import hashlib

li1 = hashlib.md5()  # <md5 HASH object @ 0x000001A18ADE7648>
li2 = hashlib.sha256()  # <sha256 HASH object @ 0x000001A18ADE7558>
li3 = hashlib.sha512()
print(li1, li2, li3)

li1.update("hello".encode("utf-8"))  # 更新加密
print(li1.hexdigest(), len(li1.hexdigest()))  # 32位加密

li2.update("hello".encode("utf-8"))  # 64位加密
print(li2.hexdigest(), len(li2.hexdigest()))

li3.update("hello".encode("utf-8"))  # 128位加密 sha512
print(li3.hexdigest(), len(li3.hexdigest()))
